import Vue from 'vue';
import Router from 'vue-router';
import TimeController from '@/components/TimeController';

import My from '@/components/my/My';
import Myindex from '@/components/my/Myindex';
import Mydetail from '@/components/my/Mydetail';

import You from '@/components/you/You';
import Youindex from '@/components/you/Youindex';
import Youdetail from '@/components/you/Youdetail';

import She from '@/components/she/She';
import Sheindex from '@/components/she/Sheindex';
import Shedetail from '@/components/she/Shedetail';


import He from '@/components/he/He';
import Heindex from '@/components/he/Heindex';
import Login from '@/components/he/Login';
import Register from '@/components/he/Register';
import Other from '@/components/he/Other';

Vue.use(Router);

export default new Router({
    routes: [{
            path: '/my',
            name: 'My',
            component: My,
            children: [{
                    path: 'index',
                    component: Myindex
                },
                {
                    path: 'detail/:id',
                    component: Mydetail
                }
            ]
        },
        {
            path: '/you',
            name: 'You',
            component: You,
            children: [{
                    path: 'index',
                    component: Youindex
                },
                {
                    path: 'detail/:id',
                    component: Youdetail
                }
            ]
        },
        {
            path: '/she',
            name: 'She',
            component: She,
            children: [{
                    path: 'index',
                    component: Sheindex
                },
                {
                    path: 'detail',
                    component: Shedetail
                }
            ]
        },
        {
            path: '/he',
            name: 'He',
            component: He,
            children: [{
                    path: 'index',
                    component: Heindex
                },
                {
                    path: 'login',
                    component: Login
                },
                {
                    path: 'register',
                    component: Register
                },
                {
                    path: 'other',
                    component: Other
                },
            ]
        },
        {
            path: '*',
            redirect: '/my/index'
        }
    ],
    scrollBehavior(to, from, savedPosition) {
        return {
            x: 0,
            y: 0
        }
    }
});